define(function(require, exports){
	exports.onMain = function( boot, data, app ) {

		if(!app.routerValid('')) {
			return;
		}
		var title = LANG('黑名单');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title:title,
			type: 'sidebar'
		});

		// app.core.get('SYS_PLATFORM').setPlatform(title);

		con.createBusiness(data.name  + '_bar', 'layout/navbar.base', {
			'contentType': 'info',
			'autoBuild': true,
			'data': data,
			'addTitle': title,
			'type': 'admin'
		}, function(mod, created){
			if(mod){
				mod.setData(data, title);
			}
		});

		con.createBusiness(data.name, 'admin/blacklist/action/list.main', {

		}, function(mod, created){
			if(created){
				mod.reload();
			}
		});

	};

	exports.onEdit = function( boot, data, app ) {
		var id = +data.param;

		if(!app.routerValid('')) {
			return;
		}
		var title = id ? LANG('编辑黑名单') : LANG('新建黑名单');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title:title,
			type: 'sidebar'
		});

		// app.core.get('SYS_PLATFORM').setPlatform(title);
		con.createBusiness(data.name  + '_bar', 'layout/navbar.base', {
			'contentType': 'info',
			'autoBuild': true,
			'data': data,
			'addTitle': title,
			'type': ''
		}, function(mod, created){
			if(mod){
				mod.setData(data, title);
			}
		});

		con.createBusiness(data.name, 'admin/blacklist/action/edit.main', {

		}, function(mod, created){
			if(created){
				mod.reset();
			}
			if(id){
				mod.load(id);
			}
		});

	};

	exports.onSaveas = function( boot, data, app ) {
		var id = +data.param;

		if(!app.routerValid('')) {
			return;
		}
		var title = id ? LANG('另存为黑名单') : LANG('另存为黑名单');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title:title,
			type: 'sidebar'
		});

		// app.core.get('SYS_PLATFORM').setPlatform(title);
		con.createBusiness(data.name  + '_bar', 'layout/navbar.base', {
			'contentType': 'info',
			'autoBuild': true,
			'data': data,
			'addTitle': title,
			'type': ''
		}, function(mod, created){
			if(mod){
				mod.setData(data, title);
			}
		});

		con.createBusiness(data.name, 'admin/blacklist/action/edit.main', {

		}, function(mod, created){
			if(created){
				mod.reset();
			}
			if(id){
				mod.load(id, true);
			}
		});

	};
});